#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <set>
#include <algorithm>
#include <math.h>
#include <stdarg.h>
using namespace std;

typedef long long int64;

int Factorial(int num) {
    int res = 1;
    for (int i = 1; i <= num; ++i)
        res *= i;
    return res;
}

bool IsPrime(int num) {
    for (int i = 2; i*i <= num; ++i) {
        if (num % i == 0)
            return false;
    }
    return true;
}

bool IsCircularPrime(int num) {
    vector<int> digits;
    while (num) {
        digits.push_back(num % 10);
        num /= 10;
    }

    const size_t cnt = digits.size();
    for (int i = 1; i < cnt; ++i) {
        int tmp = 0;
        for (int j = 0; j < cnt; ++j) {
            //tmp += pow(10, digits[(i+j)%cnt]);
            tmp += (digits[(i+j)%cnt] * pow(10, j));
        }
        if (!IsPrime(tmp))
            return false;
    }

    return true;
}


int Foo(int n, ...) {
    int *p = &n;
    ++p;
    int res = 0;
    for (int i = 0; i <n; ++i)
        res += *p++;
    return res;
}

int MegaFoo(int n, ...) {
    va_list ap;
    va_start(ap, n);
    for (i = n; i >= 0; i = va_arg(ap, int))
        
    va_end(ap);
}

int main() {
    cout << Foo(4, 1, 2, 3, 4) << endl;
    return 0;
}
